
import { _decorator, Component, Node, Button, EditBox } from 'cc';
import { TestSocketioClien } from '../netio/testSocketioClien';
const { ccclass, property } = _decorator;

/**
 * Predefined variables
 * Name = CreateRoomBtCl
 * DateTime = Wed Mar 23 2022 21:09:15 GMT+0800 (中国标准时间)
 * Author = mdkmarui
 * FileBasename = createRoomBtCl.ts
 * FileBasenameNoExtension = createRoomBtCl
 * URL = db://assets/secripts/ui/createRoomBtCl.ts
 * ManualUrl = https://docs.cocos.com/creator/3.3/manual/zh/
 *
 */
 
@ccclass('CreateRoomBtCl')
export class CreateRoomBtCl extends Component {
    @property(Button)
    button: Button | null = null;
    @property(EditBox)
    rid: EditBox | null = null;

    onLoad () {
        this.button.node.on(Button.EventType.CLICK, this.callback, this);
    }

    callback (button: Button) {
        let socketcl = TestSocketioClien.instance;
        socketcl.croom(this.rid.string);
    }
}

/**
 * [1] Class member could be defined like this.
 * [2] Use `property` decorator if your want the member to be serializable.
 * [3] Your initialization goes here.
 * [4] Your update function goes here.
 *
 * Learn more about scripting: https://docs.cocos.com/creator/3.3/manual/zh/scripting/
 * Learn more about CCClass: https://docs.cocos.com/creator/3.3/manual/zh/scripting/ccclass.html
 * Learn more about life-cycle callbacks: https://docs.cocos.com/creator/3.3/manual/zh/scripting/life-cycle-callbacks.html
 */
